﻿
using SheepStorage.Repository.BaseImp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SheepStorage.Repository.Interface
{
    public interface IBaseRepository<T>
    {
        //查询
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        IQueryable<T> GetAll();

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
         int Add(T entity);

        int AddRange(List<T> entitys);
        //修改-逻辑删除
         int Update(T entity);
    

        /// <summary>
        /// 删除物理删除
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
         int Delete(T entity);

        /// <summary>
        /// 批量删除-物理删除
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        int DeleteRange(List<T>entity);

        // 批量删除/逻辑删除
        int UpdateRange(List<T> idList);

        //查询单个
        T GetInfoBy(int id);


        /// <summary>
        /// 单个删除 真
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
         int Del(int id);

         T GetValue(int id);




    }
}
